package com.itheima2.work2;

import java.util.ArrayList;

public class StudentTest {
    public static void main(String[] args) {
        ArrayList<Student> list = new ArrayList<>();
        list.add(new Student("heima001", "张三", 23));
        list.add(new Student("heima002", "李四", 24));
        list.add(new Student("heima003", "张三", 23));
        list.add(new Student("heima001", "张三", 23));
        list.add(new Student("heima001", "张三", 23));
        list.add(new Student("heima002", "李四", 24));
        list.add(new Student("heima001", "张三", 23));
        list.add(new Student("heima002", "李四", 24));
        list.add(new Student("heima002", "李四", 24));
        for (int i = 0; i < list.size(); i++) {
            for (int i1 = 1; i1 < list.size(); i1++) {
                if (list.get(i).equals(list.get(i1))){
                    list.remove(i1);
                }
            }
        }
        for (int i = 0; i < list.size(); i++) {
            Student stu =list.get(i);
            System.out.println(stu);
        }
    }
}
